<HTML>
<HEAD>
  <!-- Created with AOLpress/2.0 -->
  <!-- AP: Created on: 3-Aug-2002 -->
  <!-- AP: Last modified: 16-Apr-2004 -->
  <LINK REL="icon" href="fftype16.png">
  <TITLE>X Input Methods</TITLE>
  <LINK REL="stylesheet" TYPE="text/css" HREF="FontForge.css">
</HEAD>
<BODY>
<DIV id="in">
<P>
For entering text in CJK languages, simple keyboard typing is not adequate.
Instead there are programs that run and handle the conversion of keystrokes
to characters these programs are called input methods.
<P>
I have tested FontForge with two freely available input methods (as well
as one can who speaks neither Chinese, Japanese nor Korean) kinput2 (for
Japanese) and <A HREF="http://xcin.linux.org.tw/">xcin</A> (for Chinese).
<P>
There is reasonably good (English) documentation on installing and using
kinput2 on the mozilla site, and at
<A HREF="http://www.suse.de/~mfabian/suse-cjk/kinput2.html">suse</A>, kinput2
has the interesting complexity that it requires yet another server to be
running, generally either cannaserver or jserver. It looks to me as though
it might be possible to use a chinese or korean jserver with kinput2 but
I have not tried this.
<P>
There is good Chinese and English documentation on xcin at the
<A HREF="http://xcin.linux.org.tw/">xcin site in Taiwan </A>(english is not
the default here, but it is available about 3 lines down).
<P>
One of the most difficult problems I had in installing these was finding
the appropriate locales. I could not find them in my RedHat 7.3 distribution,
nor could I find any RedHad rpms containing them. There is a good supply
of Mandrake locale rpms (named <CODE>locales-zh*</CODE> for chinese,
<CODE>locales-jp* </CODE>for japanese, etc.) but Mandrake stores them in
a different directory so after installing them I had to copy them from
<CODE>/usr/share/locales</CODE> to <CODE>/usr/lib/locales</CODE>. The SUSE
docs imply that the current SUSE distribution ships with these locales.
<P>
To start fontforge with an input method you must first insure that the input
method itself is running. For kinput2 do the following:
<BLOCKQUOTE>
  <PRE>$ cannaserver &amp;
$ kinput2 -canna -xim &amp;
</PRE>
</BLOCKQUOTE>
<P>
While for xcin:
<BLOCKQUOTE>
  <PRE>$ setenv LC_CTYPE zh_TW.Big5		(or $ LC_CTYPE=zh_TW.Big5 ; export LC_CTYPE )
$ xcin &amp;
</PRE>
</BLOCKQUOTE>
<P>
Beware: Different systems will have slightly different locale names (sometimes
it's <CODE>zh_TW.big5</CODE>, or something else) so if things don't work
try something else.
<P>
Once you've started your input method you must then start FontForge. You
should set the LC_CTYPE environment variable (or LC_ALL or LANG) to the
appropriate locale. You may (if you have multiple input methods running that
support the same locale) need to set the XMODIFIERS environment variable
to the name of your method (xcin can have multiple names, it prints out the
one it is currently using on start-up).
<BLOCKQUOTE>
  <PRE>$ setenv LC_CTYPE ja_JP.eucJP
$ setenv XMODIFIERS "@im=kinput2"
$ fontforge -new
</PRE>
</BLOCKQUOTE>
<P>
FontForge will start up significantly more slowly when connecting to an IM,
just be patient with it. FontForge supports OverTheSpot input in textfields
and Root input in the font and outline character views. Not all textfields
accept unicode input, but any that do should now accept input from an IM.
<P>
<FONT COLOR="Red"><SMALL><STRONG>This only works if
<CODE>X_HAVE_UTF8_STRING</CODE> is defined -- an XFree 4.0.2 extension (ie.
not on solaris)</STRONG></SMALL></FONT>
<P>
  <HR>
<P>
If you are interested in the mechanics of XIM programming I refer you to
O'Reilly's excellent
<A HREF="http://capderec.udg.es:81/ebt-bin/nph-dweb/dynaweb/SGI_Developer/XLib_PG/@Generic__BookView">Programmers
Reference Guide for X11</A>, chapter 11.
<P>
</DIV>
</BODY></HTML>
